/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2025-02-12
 * Time: 10:29
 */
class Solution12 {
    public int climbStairs(int n) {
        if(n == 1) return 1;
        if(n == 2) return 2;
        int[] array = new int[2*n];
        array[1] = 1;
        array[2] = 2;
        for(int i = 3 ; i <= n ; i++){
            array[i] = array[i-1] + array[i-2];
        }
        return array[n];
    }
}
public class Test12 {
}
